package com.pth.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.Policy;
import com.pth.service.PolicyService;

@SuppressWarnings("serial")
public class PolicyAllAction extends ActionSupport {

	private int id;
	
	private PolicyService policyService;
	
	private Policy policy;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public PolicyService getPolicyService() {
		return policyService;
	}

	public void setPolicyService(PolicyService policyService) {
		this.policyService = policyService;
	}

	public Policy getPolicy() {
		return policy;
	}

	public void setPolicy(Policy policy) {
		this.policy = policy;
	}
	
	
	public String delete() throws Exception{
		
		
		Policy p=policyService.getPolicyByid(id);
		policyService.delete(p);
		return "delete";
	}
	
	
	public String modify() throws Exception{
		
		
		policyService.modify(policy);
		
		return "modify";
	}
	
}
